<?php
namespace BP\Frm;
require_once("BP/En/Map.php");
require_once("BP/Web/WebUser.php");
class FrmTemplate extends EntityNoName {
	public function getHisUAC () 
	{
		$uac = new UAC();
		if ($WebUser->getNo()->equals("admin"))
		{
			$uac->IsDelete =  FALSE ;
			$uac->IsUpdate =  TRUE ;
			return $uac;
		}
		$uac->Readonly();
		return $uac;
	}
	public function getPTable () 
	{
		$s = $this->GetValStrByKey($MapDataAttr->PTable);
		if ((($s . NULL) . $s->equals("")))
		{
			return $this->getNo();
		}
		return $s;
	}
	public function setPTable ($value) // [String value]
	{
		$this->SetValByKey($MapDataAttr->PTable, $value);
	}
	public function getEntityType () 
	{
		return EntityType->forValue($this->GetValIntByKey(FrmTemplateAttr::$EntityType));
	}
	public function setEntityType ($value) // [EntityType value]
	{
		$this->SetValByKey(FrmTemplateAttr::$EntityType, $value->getValue());
	}
	public function getFrmType () 
	{
		return $FrmType->forValue($this->GetValIntByKey($MapDataAttr->FrmType));
	}
	public function setFrmType ($value) // [FrmType value]
	{
		$this->SetValByKey($MapDataAttr->FrmType, $value->getValue());
	}
	public function getFK_FormTree () 
	{
		return $this->GetValStrByKey($MapDataAttr->FK_FormTree);
	}
	public function setFK_FormTree ($value) // [String value]
	{
		$this->SetValByKey($MapDataAttr->FK_FormTree, $value);
	}
	public function getBtnNewModel () 
	{
		return $this->GetValIntByKey(FrmTemplateAttr::$BtnNewModel);
	}
	public function setBtnNewModel ($value) // [int value]
	{
		$this->SetValByKey(FrmTemplateAttr::$BtnNewModel, $value);
	}
	public function getBillNoFormat () 
	{
		$str = $this->GetValStrByKey(FrmTemplateAttr::$BillNoFormat);
		if (($DataType->IsNullOrEmpty($str) ==  TRUE ))
		{
			$str = "{LSH4}";
		}
		return $str;
	}
	public function setBillNoFormat ($value) // [String value]
	{
		$this->SetValByKey(FrmTemplateAttr::$BillNoFormat, $value);
	}
	public function getTitleRole () 
	{
		$str = $this->GetValStrByKey(FrmTemplateAttr::$TitleRole);
		if (($DataType->IsNullOrEmpty($str) ==  TRUE ))
		{
			$str = "@WebUser.getFK_DeptName @WebUser.getName() @RDT";
		}
		return $str;
	}
	public function setTitleRole ($value) // [String value]
	{
		$this->SetValByKey(FrmTemplateAttr::$BillNoFormat, $value);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__String ($no) // [String no]
	{
		$me = new self();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_MapData", "单据模版");
		$map->Java_SetEnType($EnType->Sys);
		$map->Java_SetCodeStruct("4");
		$map->AddTBStringPK($MapDataAttr->No, NULL, "表单编号",  TRUE ,  TRUE , 1, 190, 20);
		$map->SetHelperAlert($MapDataAttr->No, "也叫表单ID,系统唯一.");
		$map->AddDDLSysEnum($MapDataAttr->FrmType, 0, "表单类型",  TRUE ,  TRUE , "BillFrmType", "@0=傻瓜表单@1=自由表单");
		$map->AddTBString($MapDataAttr->PTable, NULL, "存储�?",  TRUE ,  FALSE , 0, 500, 20,  TRUE );
		$map->SetHelperAlert($MapDataAttr->PTable, "存储的表�?,如果您修改一个不存在的系统将会自动创建一个表.");
		$map->AddTBString($MapDataAttr->Name, NULL, "表单名称",  TRUE ,  FALSE , 0, 200, 20,  TRUE );
		$map->AddDDLEntities($MapDataAttr->FK_FormTree, "01", "表单类别", new SysFormTrees(),  FALSE );
		$map->AddDDLSysEnum(FrmAttr::$RowOpenModel, 0, "行记录打�?模式",  TRUE ,  TRUE , FrmAttr::$RowOpenModel, "@0=新窗口打�?@1=弹出窗口打开,关闭后刷新列表@2=弹出窗口打开,关闭后不刷新列表");
		$map->AddDDLSysEnum(FrmTemplateAttr::$EntityType, 0, "业务类型",  TRUE ,  FALSE , FrmTemplateAttr::$EntityType, "@0=独立表单@1=单据@2=编号名称实体@3=树结构实�?");
		$map->SetHelperAlert(FrmTemplateAttr::$EntityType, "该实体的类型,@0=单据@1=编号名称实体@2=树结构实�?.");
		$map->AddDDLSysEnum(FrmAttr::$EntityShowModel, 0, "展示模式",  TRUE ,  TRUE , FrmAttr::$EntityShowModel, "@0=表格@1=树干模式");
		$map->AddTBString(FrmTemplateAttr::$BillNoFormat, NULL, "实体编号规则",  TRUE ,  FALSE , 0, 100, 20,  TRUE );
		$map->SetHelperAlert(FrmTemplateAttr::$BillNoFormat, "\t\n实体编号规则: \t\n 2标识:01,02,03�?, 3标识:001,002,003,�?..");
		$map->AddTBInt(FrmTemplateAttr::$EntityEditModel, 0, "编辑模式",  TRUE ,  FALSE );
		$map->getAttrsOfOneVSM()->AddGroupPanelModel(StationCreates::constructor__(), new Stations(), StationCreateAttr::$FrmID, StationCreateAttr::$FK_Station, "可以创建的岗�?", $StationAttr->FK_StationType);
		$map->getAttrsOfOneVSM()->AddGroupListModel(StationCreates::constructor__(), new Stations(), StationCreateAttr::$FrmID, StationCreateAttr::$FK_Station, "可以创建的岗位AddGroupListModel", $StationAttr->FK_StationType);
		$map->getAttrsOfOneVSM()->AddBranches(FrmDeptCreates::constructor__(), new Depts(), FrmDeptCreateAttr::$FrmID, FrmDeptCreateAttr::$FK_Dept, "可以创建的部门AddBranches", $EmpAttr->Name, $EmpAttr->No, "@WebUser.getFK_Dept()");
		$map->getAttrsOfOneVSM()->AddBranchesAndLeaf(EmpCreates::constructor__(), new Emps(), EmpCreateAttr::$FrmID, EmpCreateAttr::$FK_Emp, "可以创建的人�?", $EmpAttr->FK_Dept, $EmpAttr->Name, $EmpAttr->No, "@WebUser.getFK_Dept()");
		$this->set_enMap($map);
		return $this->get_enMap();
	}
}
?>
